<template>
  <div>
    <h2>{{ $store.state.user.username }}</h2>
    <button @click="$store.commit('user/updateName', 'chann')">
      updateName
    </button>
    <h2>{{$store.getters["user/userGetters"]}}</h2>
    <hr>
    <h2>主文件的count:{{$store.state.count}}</h2>
    <h2>user的num:{{$store.state.user.num}}</h2>
    <button @click="$store.commit('user/increment')">user/increment</button>
    <button @click="$store.commit('increment')">increment</button>
    <hr>
    <button @click="$store.dispatch('user/userActionsRoot')">root:true</button>
    <button @click="$store.dispatch('user/userActions')">userActions</button>
  </div>
</template>

<script>
import { onMounted } from "vue";
import { useStore } from "vuex";

export default {
  setup() {
    onMounted(() => {
      
    })
    return {};
  },
};
</script>

<style lang="scss" scoped>
</style>